//
//  NineVideoView.m
//  YUNWUMeetingDemo
//
//  Created by mac on 2019/7/19.
//  Copyright © 2019 DGL. All rights reserved.
//

#import "NineVideoView.h"

@implementation NineVideoView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUI];
    }
    return self;
}

#pragma mark -- UI
- (void)setUI{
    _nineOneView = [[CustomCameraView alloc]init];
    _nineOneView.backgroundColor = [UIColor yellowColor];
    [self addSubview:_nineOneView];
    [_nineOneView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_equalTo(self);
        make.width.mas_equalTo((Width-1)/3);
        make.height.mas_equalTo((Width-40)/3 + 20);
    }];
    
    _nineTwoView = [[CustomCameraView alloc]init];
    _nineTwoView.backgroundColor = [UIColor greenColor];
    [self addSubview:_nineTwoView];
    [_nineTwoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_nineOneView.mas_right).offset(1);
        make.top.mas_equalTo(self.mas_top);
        make.width.mas_equalTo(_nineOneView.mas_width);
        make.height.mas_equalTo(_nineOneView.mas_height);
    }];
    
    _nineThreeView = [[CustomCameraView alloc]init];
    _nineThreeView.backgroundColor = [UIColor grayColor];
    [self addSubview:_nineThreeView];
    [_nineThreeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_nineTwoView.mas_right).offset(1);
        make.top.mas_equalTo(self.mas_top);
        make.width.mas_equalTo(_nineOneView.mas_width);
        make.height.mas_equalTo(_nineOneView.mas_height);
    }];
    
    _nineFourView = [[CustomCameraView alloc]init];
    _nineFourView.backgroundColor = [UIColor grayColor];
    [self addSubview:_nineFourView];
    [_nineFourView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left);
        make.top.mas_equalTo(_nineOneView.mas_bottom).offset(1);
        make.width.mas_equalTo(_nineOneView.mas_width);
        make.height.mas_equalTo(_nineOneView.mas_height);
    }];
    
    _nineFiveView = [[CustomCameraView alloc]init];
    _nineFiveView.backgroundColor = [UIColor greenColor];
    [self addSubview:_nineFiveView];
    [_nineFiveView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_nineFourView.mas_right).offset(1);
        make.top.mas_equalTo(_nineTwoView.mas_bottom).offset(1);
        make.width.mas_equalTo(_nineOneView.mas_width);
        make.height.mas_equalTo(_nineOneView.mas_height);
    }];
    
    _nineSixView = [[CustomCameraView alloc]init];
    _nineSixView.backgroundColor = [UIColor grayColor];
    [self addSubview:_nineSixView];
    [_nineSixView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_nineFiveView.mas_right).offset(1);
        make.top.mas_equalTo(_nineThreeView.mas_bottom).offset(1);
        make.width.mas_equalTo(_nineOneView.mas_width);
        make.height.mas_equalTo(_nineOneView.mas_height);
    }];
    
    _nineEightView = [[CustomCameraView alloc]init];
    _nineEightView.backgroundColor = [UIColor grayColor];
    [self addSubview:_nineEightView];
    [_nineEightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left);
        make.top.mas_equalTo(_nineFourView.mas_bottom).offset(1);
        make.width.mas_equalTo(_nineOneView.mas_width);
        make.height.mas_equalTo(_nineOneView.mas_height);
    }];
    
    _nineSevenView = [[CustomCameraView alloc]init];
    _nineSevenView.backgroundColor = [UIColor greenColor];
    [self addSubview:_nineSevenView];
    [_nineSevenView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_nineEightView.mas_right).offset(1);
        make.top.mas_equalTo(_nineFourView.mas_bottom).offset(1);
        make.width.mas_equalTo(_nineOneView.mas_width);
        make.height.mas_equalTo(_nineOneView.mas_height);
    }];
    
    _nineNineView = [[CustomCameraView alloc]init];
    _nineNineView.backgroundColor = [UIColor grayColor];
    [self addSubview:_nineNineView];
    [_nineNineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_nineSevenView.mas_right).offset(1);
        make.top.mas_equalTo(_nineFourView.mas_bottom).offset(1);
        make.width.mas_equalTo(_nineOneView.mas_width);
        make.height.mas_equalTo(_nineOneView.mas_height);
    }];
}

@end
